package me.zhengjie.modules.lock.service.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zelk.smartlock.common.constant.Constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel("门锁密码列表响应结果")
@Data
public class LockPwdListDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商户Id", dataType = "String")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long partnerId;

    @ApiModelProperty(value = "商户名称", dataType = "String")
    private String partnerName;

    @ApiModelProperty(value = "密码ID", dataType = "Long")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long pwdId;

    @ApiModelProperty(value = "密码ID", dataType = "Integer")
    private Integer idx;

    @ApiModelProperty(value = "密码别名", dataType = "String")
    private String alias;

    @ApiModelProperty(value = "密码", dataType = "String")
    private String pwd;

    @ApiModelProperty(value = "密码类型，（once：一次性密码 normal：时效密码 forever：永久密码 clear：清空密码）", dataType = "String")
    private String type;

    @JsonFormat(pattern = Constant.DATA_FORMAT, timezone = Constant.TIME_ZONE)
    @ApiModelProperty(value = "密码有效期开始时间")
    private LocalDateTime startTime;

    @JsonFormat(pattern = Constant.DATA_FORMAT, timezone = Constant.TIME_ZONE)
    @ApiModelProperty(value = "密码有效期结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "密码状态(init:待生效，effect:已生效，invalid:已失效)", dataType = "String")
    private String status;

    @ApiModelProperty(value = "密码被修改(true：被修改，false：未被修改(这里不是绝对，存在在门锁上修改了密码，但未同步服务器的情况))")
    private Boolean isChange;

    @JsonFormat(pattern = Constant.DATA_FORMAT, timezone = Constant.TIME_ZONE)
    @ApiModelProperty(value = "密码创建时间")
    private LocalDateTime createTime;
}
